Skip to content

Conversation

clubby789
Copy link
Contributor

@clubby789 clubby789 commented Jul 26, 2022

Adds a lint to check for a raw slice being created and cast back to a pointer, suggesting ptr::slice_from_raw_parts, to identify UB such as thomcc/rust-typed-arena#54.

changelog: [`cast_slice_from_raw_parts`]: Add lint to check for `slice::from_raw_parts(.., ..) as *const _`

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 26, 2022
@clubby789 clubby789 changed the title Raw slice pointer cast New lint: Raw slice pointer cast Jul 26, 2022
@clubby789 clubby789 marked this pull request as draft July 26, 2022 19:36
@clubby789 clubby789 marked this pull request as ready for review July 27, 2022 00:44
@Alexendoo
Copy link
Member

Hi @clubby789, welcome to Clippy! The lint looks good, thanks for the PR

@bors
Copy link
Contributor

bors commented Aug 19, 2022

☔ The latest upstream changes (presumably #8957) made this pull request unmergeable. Please resolve the merge conflicts.

@clubby789 clubby789 force-pushed the raw_slice_pointer_cast branch from 83b46b7 to 1711368 Compare August 29, 2022 12:56
@clubby789 clubby789 force-pushed the raw_slice_pointer_cast branch from 1711368 to 30979bf Compare August 29, 2022 13:10
@Alexendoo
Copy link
Member

Looks good, thank you for the lint!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 29, 2022

📌 Commit cc9f203 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 29, 2022

⌛ Testing commit cc9f203 with merge e9f7ce1...

@bors
Copy link
Contributor

bors commented Aug 29, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing e9f7ce1 to master...

@bors bors merged commit e9f7ce1 into rust-lang:master Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants